import {
  Controller,
  Get,
  Post,
  Body,
  Query,
  Header,
  UseGuards,
  Request,
} from '@nestjs/common';
import { AccessService } from './access.service';
import { AuthGuard } from '@nestjs/passport';

@UseGuards(AuthGuard('jwt'))
@Controller('access')
export class AccessController {
  constructor(private readonly accessService: AccessService) {}
  //保存创建角色
  @Post('/saveAccess')
  async saveAccess(@Body() param) {
    return await this.accessService.saveAccess(param);
  }
  @Post('/saveAccessList')
  async saveAccessList(@Body() param) {
    return await this.accessService.saveAccessList(param);
  }
  //查询角色
  @Get('/getAccess')
  async getAccess(@Query() param) {
    return await this.accessService.getAccess(param);
  }
  //查询角色列表
  @Post('/getAccessList')
  async getAccessList(@Body() param) {
    return await this.accessService.getAccessList(param);
  }
  //批量删除角色
  @Post('/delAccessList')
  async delAccessList(@Body() param) {
    return await this.accessService.delAccessList(param);
  }
}
